package com.management.service.Impl;

import com.management.dao.SectionDao;
import com.management.po.Section;
import com.management.service.SectionService;
import com.management.vo.SectionVO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @category:
 * @author: cwsheng
 * @version: 1.0
 * @date: 2021/10/29 11:29
 */
@Service
public class SectionServiceImpl implements SectionService {
    @Resource
    SectionDao sectionDao;
    @Override
    public List<SectionVO> findAll() {
        return sectionDao.findAll();
    }

    @Override
    public List<SectionVO> findByDeptId(int deptId) {
        return sectionDao.findByDeptId(deptId);
    }

    @Override
    public SectionVO findBySectionId(int sectionId) {
        return sectionDao.findBySectionId(sectionId);
    }

    @Override
    public boolean add(Section section) {
        return sectionDao.add(section)>0?true:false;
    }

    @Override
    public boolean delete(int[] sectionIds) {
        return sectionDao.delete(sectionIds)>0?true:false;
    }

    @Override
    public boolean update(Section section) {
        return sectionDao.update(section)>0?true:false;
    }
}
